import { NavBar, Icon } from 'antd-mobile';
import styles from './index.scss'

const header = ({ current, history }) => {
  const { name, path } = current
  return (
    <NavBar
      className={styles.NavBar}
      mode="dark"
      leftContent={path.length !== 1 && <Icon key="0" type="left" onClick={() => history.go(-1)} />}
      rightContent={[
        <Icon key="1" type="ellipsis" />,
      ]}
    >{name || '-'}</NavBar>
  )
}

export default header
